package com.code.bolg.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 页面之间的跳转
 *
 * @author 2018-10-12
 */
@Controller
@RequestMapping("/page")
public class PageController {
    @Value("${sys.webPath}")
    String webPath;
    @Value("${sys.imgPath}")
    String imgPath;
    @Value("${sys.apiPath}")
    String apiPath;
    @Value("${sys.title}")
    String title;
    @ModelAttribute
    public void init(Model model){
        model.addAttribute("imgPath", imgPath);
        model.addAttribute("webPath", webPath);
        model.addAttribute("apiPath", apiPath);
        model.addAttribute("title", title);
    }
    /**
     * 详情页
     * @return
     */
    @RequestMapping("/details")
    public String datails(Integer id,Model model) {
        model.addAttribute("id",id);
        return "html/details";
    }
    /**
     * 发表评论
     * @return
     */
    @RequestMapping("/comment")
    public String comment() {

        return "html/comment";
    }
    /**
     * 留言
     * @return
     */
    @RequestMapping("/message")
    public String message() {

        return "html/message";
    }
    /**
     * 关于
     * @return
     */
    @RequestMapping("/about")
    public String about() {

        return "html/about";
    }
    /**
     * 用户
     * @return
     */
    @RequestMapping("/user")
    public String user() {

        return "html/user";
    }
    /**
     * 注册
     * @return
     */
    @RequestMapping("/reg")
    public String reg() {

        return "html/reg";
    }


    /**
     * 后台
     * @return
     */
    @RequestMapping("/backstage")
    public String backstage() {

        return "html/backstage";
    }
}

